﻿using DataTransfer.SDK.Models;
using Microsoft.Extensions.Configuration;

namespace DataTransfer.Core.Configurations
{
    /// <summary>
    /// 导入字段
    /// </summary>
    public class ExcelExportSheetFieldSetting
    {
        const string FIELD_NAME = "fieldName";
        const string FIELD_TYPE = "fieldType";
        const string DISPLAY_NAME = "displayName";
        const string WIDTH = "width";
        const string HEADER_FONT_SIZE = "headerFontSize";
        const string FONT_SIZE = "fontSize";
        const string FORMAT = "format";

        internal const int DEFAULT_WIDTH = 3000;
        internal const int DEFAULT_FONT_SIZE = 11;

        /// <summary>
        /// 字段名
        /// </summary>
        [ConfigurationKeyName(FIELD_NAME)]
        public string FieldName
        {
            get;
            set;
        }
        /// <summary>
        /// 字段显示名
        /// </summary>
        [ConfigurationKeyName(DISPLAY_NAME)]
        public string DisplayName
        {
            get;
            set;
        }
        /// <summary>
        /// 字段类型
        /// </summary>
        [ConfigurationKeyName(FIELD_TYPE)]
        public string FieldType
        {
            get;
            set;
        } = "System.String";

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(WIDTH)]
        public int Width
        {
            get;
            set;
        } = DEFAULT_WIDTH;

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(HEADER_FONT_SIZE)]
        public int HeaderFontSize
        {
            get;
            set;
        } = DEFAULT_FONT_SIZE;

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(FONT_SIZE)]
        public int FontSize
        {
            get;
            set;
        } = DEFAULT_FONT_SIZE;

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(FORMAT)]
        public string Format
        {
            get;
            set;
        }
    }

}
